# 进程间的通信
from multiprocessing import Process

num = 100


def run():
    print("子进程开始")
    global num
    num += 1
    print(num)
    slice(3)
    print("子进程结束")


if __name__ == "__main__":
    print("启动父进程")
    p = Process(target=run)
    p.start()
    p.join()
    print(num)
    print("父进程结束")
